Skip to content

Feat self healing prs#862

Merged
abnegate merged 9 commits intomainfrom
feat-self-healing-prs
Apr 23, 2026
Merged

Feat self healing prs#862
abnegate merged 9 commits intomainfrom
feat-self-healing-prs

Conversation

@abnegate
Copy link
Copy Markdown
Member

@abnegate abnegate commented Apr 23, 2026

Summary by CodeRabbit

  • Chores
    • Added an automated code-assistant workflow to help with PR improvements, suggestions and comment-driven automation.
    • Updated CI workflows to use pinned action versions/commit SHAs for more stable, consistent pipeline execution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d880651f-8fc2-4a41-b30e-6fe7a151d75e

📥 Commits

Reviewing files that changed from the base of the PR and between 8f90ade and 6db64ff.

📒 Files selected for processing (1)
  • .github/workflows/claude.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/claude.yml

📝 Walkthrough

Walkthrough

Adds a new GitHub Actions workflow (.github/workflows/claude.yml) that invokes an external orchestrator on PR/review/comment/workflow events, and updates multiple existing workflows to pin various GitHub Action references to specific commit SHAs instead of floating tags.

Changes

Cohort / File(s) Summary
New Claude Orchestrator Workflow
.github/workflows/claude.yml
Adds Claude workflow triggered on pull request, review, comment, issue, and workflow_run events; calls reusable abnegate/claude-pr-owner orchestrator (pinned commit) with improvement, healing, bots, comments inputs and passes CLAUDE_CODE_OAUTH_TOKEN secret.
CodeQL Action Pinning
.github/workflows/codeql-analysis.yml
Replaces actions/checkout@v4 with a pinned commit reference (checkout v6.0.2) in the CodeQL job checkout step.
Linter Action Pinning
.github/workflows/linter.yml
Replaces actions/checkout@v4 with a pinned commit reference (checkout v6.0.2) in the lint job checkout step.
Tests Workflow Action Pinning
.github/workflows/tests.yml
Pins multiple actions used across setup, unit_test, and adapter_test jobs (checkout, cache, docker/setup-buildx-action, docker/build-push-action) to specific commit SHAs instead of floating version tags.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub as GitHub Events
    participant Repo as Repository Workflow
    participant Orchestrator as abnegate/claude-pr-owner
    participant Secrets as Secrets Store

    GitHub->>Repo: PR / review / comment / workflow_run event
    Repo->>Secrets: read CLAUDE_CODE_OAUTH_TOKEN
    Repo->>Orchestrator: invoke orchestrator.yml@<pinned-commit> (inputs: improvement=true, healing=true, bots=true, comments=true)
    Orchestrator->>GitHub: act on PR/issues (create comments, suggestions, labels)
    Orchestrator-->>Repo: return status/results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 A tiny rabbit hops and finds,
New workflows tied in tidy binds,
Pins set firm, the checks align,
Orchestrator hums — everything's fine!
(˘・ᴗ・˘)

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feat self healing prs' only partially relates to the changeset; while one file adds a self-healing workflow, the PR's main focus is pinning GitHub Actions to specific commit SHAs across four workflows for security/stability. Consider a more descriptive title that captures the primary change: something like 'Pin GitHub Actions to specific commit SHAs' would better reflect the predominant change across the changeset.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-self-healing-prs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (1)
.github/actions/classify-complexity/action.yml (1)

31-37: Piping curl | bash on every run is a supply-chain soft spot.

curl -fsSL https://claude.ai/install.sh | bash trusts whatever install.sh resolves to at the moment the action runs. On a self-hosted runner this is low severity (the runner is already trusted), but the command -v claude gate only protects runners where Claude is already installed; a fresh runner will execute the script sight-unseen. If you want to harden this, consider pinning to a known installer hash or preinstalling claude as part of the runner image and letting this step just fail fast if it's missing.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/actions/classify-complexity/action.yml around lines 31 - 37, The
"Install Claude CLI" step currently pipes curl | bash (curl -fsSL
https://claude.ai/install.sh | bash) which is a supply-chain risk; change the
step to either (A) download the installer to a file, verify a pinned
checksum/signature before executing, and only then run it, or (B) remove the
inline installer and make the step fail fast if command -v claude returns false
so the runner image must include claude; update the step around the existing
command check (command -v claude) and the install invocation to implement one of
these hardened approaches and reference the same step name ("Install Claude
CLI") and installer URL when adding the checksum/verification logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/actions/classify-complexity/action.yml:
- Around line 62-72: The jq extraction is querying the wrong key and silencing
errors: update the CLASSIFICATION extraction to read from RAW's structured
output (use .structured_output.classification // empty) instead of .result |
fromjson? | .classification, and stop discarding stderr so failures surface
(remove or redirect the 2>/dev/null suppression for the claude call and/or log
RAW when CLASSIFICATION is empty); locate the RAW assignment and the
CLASSIFICATION parsing lines to apply these changes (references: RAW variable,
CLASSIFICATION variable, the jq expression and the --json-schema/--output-format
json flags).

In @.github/workflows/claude-comments.yml:
- Around line 32-35: Summary: The checkout step uses actions/checkout@v6 without
a ref, so on issue_comment events it checks out the default branch instead of
the PR head. Fix: modify the "Checkout repository" step that uses
actions/checkout@v6 to explicitly fetch the PR head by adding a ref and full
fetch (e.g. ref: ${{ github.event.pull_request.head.ref || github.head_ref ||
github.sha }} and fetch-depth: 0) so the job sees PR files; this preserves
current classifier behavior but prevents future steps (like the classifier step)
from accidentally analyzing the default branch instead of the PR head.
- Around line 13-15: The concurrency group currently named with the pattern
claude-comments-${{ github.event.issue.number ||
github.event.pull_request.number }}-${{ github.event.comment.id ||
github.event.review.id || github.run_id }} doesn't coordinate with the other
workflows; update the concurrency.group to use the same claude-pr-<branch> key
the other two workflows use (i.e., align with the claude-pr-${{ head.ref /
workflow_run.head_branch }} convention used in claude-improvement.yml and
claude-healing.yml) or, at minimum, remove the per-comment unique id so the key
is per-PR (PR number or resolved head branch) to ensure serialization against
improvement/healing runs and against other comment-triggered runs.

In @.github/workflows/claude-healing.yml:
- Around line 48-53: The checkout step uses fetch-depth: 10 which can be too
shallow for the rebase flow; change the actions/checkout usage to use
fetch-depth: 0 (or remove the fetch-depth key) so the full history is fetched,
or alternatively add a pre-rebase step that runs git fetch --unshallow (or git
fetch --deepen) before the git fetch origin && git pull --rebase origin
$HEAD_BRANCH command to ensure a proper merge base; update the Checkout PR
branch action configuration (the actions/checkout@v6 step and its fetch-depth
setting) or add the unshallow fetch step accordingly.
- Around line 3-6: The workflow_run trigger is referencing workflows: [CI],
which doesn't exist so the trigger is inert; update the workflow_run definition
in the YAML (the on: workflow_run block) to use the actual upstream workflow
name (replace workflows: [CI] with workflows: [Tests] or the correct name such
as "Tests") so the workflow_run will match the upstream workflow's name field
and fire when that workflow completes.

In @.github/workflows/claude-improvement.yml:
- Around line 7-12: The comment mentioning the sibling workflow incorrectly
names it "claude-watcher"; update the comment in claude-improvement.yml (the
block around the concurrency: group using claude-pr-${{
github.event.pull_request.head.ref }}) to reference the actual sibling workflow
filename `claude-healing.yml` and/or its `name: "Claude CI Watcher"`, or
alternatively rename the sibling workflow to match the comment; ensure the text
and any other mentions (e.g., the prompt near Line 98) consistently use the same
filename/name so repo-wide greps and future maintainers are accurate.

---

Nitpick comments:
In @.github/actions/classify-complexity/action.yml:
- Around line 31-37: The "Install Claude CLI" step currently pipes curl | bash
(curl -fsSL https://claude.ai/install.sh | bash) which is a supply-chain risk;
change the step to either (A) download the installer to a file, verify a pinned
checksum/signature before executing, and only then run it, or (B) remove the
inline installer and make the step fail fast if command -v claude returns false
so the runner image must include claude; update the step around the existing
command check (command -v claude) and the install invocation to implement one of
these hardened approaches and reference the same step name ("Install Claude
CLI") and installer URL when adding the checksum/verification logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 36169d4f-dd21-412f-9111-4b457b03cd0d

📥 Commits

Reviewing files that changed from the base of the PR and between d765945 and 564ac1a.

📒 Files selected for processing (4)
  • .github/actions/classify-complexity/action.yml
  • .github/workflows/claude-comments.yml
  • .github/workflows/claude-healing.yml
  • .github/workflows/claude-improvement.yml

Comment thread .github/actions/classify-complexity/action.yml Outdated
Comment thread .github/workflows/claude-comments.yml Outdated
Comment thread .github/workflows/claude-comments.yml Outdated
Comment thread .github/workflows/claude-healing.yml Outdated
Comment thread .github/workflows/claude-healing.yml Outdated
Comment thread .github/workflows/claude-improvement.yml Outdated
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 23, 2026

Greptile Summary

This PR introduces a new claude.yml workflow that delegates to an SHA-pinned external reusable orchestrator, and hardens all existing CI workflows by replacing mutable version tags (@v3/@v4) with full commit SHAs — addressing the supply-chain concerns raised in prior reviews.

  • The id-token: write permission in claude.yml grants OIDC token generation to the external reusable workflow; if cloud OIDC federation is configured in the account, this allows the callee to authenticate against cloud infrastructure. Confirm whether the orchestrator actually requires it.

Confidence Score: 4/5

Safe to merge after confirming whether id-token: write is genuinely required by the external orchestrator.

The SHA-pinning improvements are a solid hardening step. The one open question — id-token: write delegated to an external reusable workflow — is a P2 finding but touches a real security boundary worth confirming before merge.

.github/workflows/claude.yml — review the id-token: write permission grant to the external reusable workflow.

Security Review

  • id-token: write granted to external reusable workflow (.github/workflows/claude.yml line 27): the external orchestrator at abnegate/claude-pr-owner receives OIDC token generation capability, which can be used to authenticate with cloud providers via federation. Verify this permission is genuinely required.

Important Files Changed

Filename Overview
.github/workflows/claude.yml New workflow delegating to an external reusable workflow (SHA-pinned); grants broad permissions including id-token: write, contents: write, and pull-requests: write to the external callee.
.github/workflows/tests.yml All action references updated from mutable version tags (@v3/@v4) to SHA-pinned versions with version comments; no logic changes.
.github/workflows/codeql-analysis.yml Checkout action pinned from @v4 to SHA de0fac2e... (v6.0.2); straightforward hardening change.
.github/workflows/linter.yml Checkout action pinned from @v4 to SHA de0fac2e... (v6.0.2); straightforward hardening change.

Reviews (6): Last reviewed commit: "(chore): pin claude-pr-owner to v0.1.0" | Re-trigger Greptile

Comment thread .github/actions/classify-complexity/action.yml Outdated
Comment thread .github/workflows/claude-comments.yml Outdated
Comment thread .github/workflows/claude-comments.yml Outdated
Comment thread .github/workflows/claude-healing.yml Outdated
Comment thread .github/workflows/claude-improvement.yml Outdated
Comment thread .github/workflows/claude-healing.yml Outdated
Comment thread .github/workflows/claude.yml Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/tests.yml (1)

25-25: docker/build-push-action@v3.3.1 is several majors behind.

v3.3.1 is from 2023; the action is now on v6/v7 with numerous BuildKit/cache fixes. Since this step uses cache-from: type=gha / cache-to: type=gha,mode=max, staying on v3 risks incompatibility with the current GHA cache service (same v1→v2 cache-service migration affecting actions/cache). Consider bumping to the latest v6.x and pinning its SHA. Same recommendation for docker/setup-buildx-action on line 22 if versions need to stay in sync.

What is the latest release tag and commit SHA for docker/build-push-action and docker/setup-buildx-action?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/tests.yml at line 25, The workflow pins
docker/build-push-action to an old commit
("docker/build-push-action@1104d471...") which is several major versions behind;
update the uses entry for docker/build-push-action to the latest v6.x release
tag and its corresponding commit SHA (pin the SHA instead of just the tag) and
likewise update docker/setup-buildx-action to the current vX release tag and SHA
so BuildKit/cache fixes are included; locate the two uses lines (the "uses:
docker/build-push-action@..." and "uses: docker/setup-buildx-action@..."
entries) and replace them with the latest stable v6 (for build-push-action) and
matching setup-buildx-action releases, ensuring cache-from/cache-to settings
remain unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/tests.yml:
- Line 25: The workflow pins docker/build-push-action to an old commit
("docker/build-push-action@1104d471...") which is several major versions behind;
update the uses entry for docker/build-push-action to the latest v6.x release
tag and its corresponding commit SHA (pin the SHA instead of just the tag) and
likewise update docker/setup-buildx-action to the current vX release tag and SHA
so BuildKit/cache fixes are included; locate the two uses lines (the "uses:
docker/build-push-action@..." and "uses: docker/setup-buildx-action@..."
entries) and replace them with the latest stable v6 (for build-push-action) and
matching setup-buildx-action releases, ensuring cache-from/cache-to settings
remain unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b074e1b0-871d-4813-86c7-8a5ec01688e3

📥 Commits

Reviewing files that changed from the base of the PR and between 564ac1a and 8f90ade.

📒 Files selected for processing (4)
  • .github/workflows/claude.yml
  • .github/workflows/codeql-analysis.yml
  • .github/workflows/linter.yml
  • .github/workflows/tests.yml
✅ Files skipped from review due to trivial changes (3)
  • .github/workflows/linter.yml
  • .github/workflows/codeql-analysis.yml
  • .github/workflows/claude.yml

@abnegate abnegate merged commit 33e1b13 into main Apr 23, 2026
36 of 37 checks passed
@abnegate abnegate deleted the feat-self-healing-prs branch April 23, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant